package com.wangzha.business.service;

import com.jfinal.plugin.activerecord.Model;
import com.wangzha.common.base.service.BaseService;
import com.wangzha.common.model.DeviceGroup;

import java.util.List;

public class DeviceGroupService extends BaseService {

    private DeviceGroup dao = new DeviceGroup().dao();

    @Override
    public Model<?> getDao() {
        return dao;
    }


    public List<DeviceGroup> findByUserCode(String userCode) {
        return dao.find("select * from device_group where user_code = ?", userCode);
    }

    public List<DeviceGroup> findByUserCodeAndPlatformCode(String userCode, int platformCode) {
        return dao.find("select * from device_group where user_code = ?", userCode, platformCode);
    }
}
